ALTER TABLE Users Add ArchitectId INT NULL
GO

ALTER TABLE Users Add BuilderId INT NULL
GO

ALTER TABLE [dbo].[Users]  WITH CHECK ADD  CONSTRAINT [FK_Users_Architects] FOREIGN KEY([ArchitectId])
REFERENCES [dbo].[Architects] ([Id])
GO

ALTER TABLE [dbo].[Users] CHECK CONSTRAINT [FK_Users_Architects]
GO

ALTER TABLE [dbo].[Users]  WITH CHECK ADD  CONSTRAINT [FK_Users_Builders] FOREIGN KEY([BuilderId])
REFERENCES [dbo].[Builders] ([Id])
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[Properties](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](150) NULL,
	[Area] [varchar](150) NULL,
	[Price] [decimal](18, 0) NULL,
	[Luxury] [varchar](150) NULL,
	[Transaction] [varchar](150) NULL,
	[Possession] [varchar](50) NULL,
	[Ownership] [varchar](50) NULL,
	[Age] [varchar](50) NULL,
	[Description] [varchar](250) NULL,
	[Features] [varchar](150) NULL,
	[UserId] [int] NOT NULL,
	[DateAdded] [datetime] NULL,
 CONSTRAINT [PK_Properties] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[Properties]  WITH CHECK ADD  CONSTRAINT [FK_Properties_Users] FOREIGN KEY([UserId])
REFERENCES [dbo].[Users] ([Id])
GO

ALTER TABLE [dbo].[Properties] CHECK CONSTRAINT [FK_Properties_Users]
GO